<template>
	<view class="page">
		<view class="body">
			<!-- 绑定银行卡 -->
			<view class="payouts_body" v-if="type == 0">
				<uni-section title="账户类型" type="line">
					<uni-data-select v-model="accountValue" :localdata="accountList" @change="change"
						style="background-color: #f4f6fa;"></uni-data-select>
				</uni-section>
				<uni-section title="姓名" type="line">
					<input class="uni-input" placeholder="请输入姓名" v-model="name" />
				</uni-section>
				<uni-section title="所属银行" type="line">
					<uni-data-select v-model="bankValue" :localdata="bankList" @change="change"
						style="background-color: #f4f6fa;"></uni-data-select>
				</uni-section>
				<uni-section title="银行账号" type="line">
					<input class="uni-input" placeholder="请输入账号" v-model="bankNumber" />
				</uni-section>
			</view>
			<!-- 绑定支付宝 -->
			<view class="payouts_body" v-if="type == 1">
				<uni-section title="姓名" type="line">
					<input class="uni-input" placeholder="请输入姓名" v-model="zfb_name" />
				</uni-section>
				<uni-section title="支付宝账号" type="line">
					<input class="uni-input" placeholder="请输入账号" v-model="zfb_Number" />
				</uni-section>
			</view>
		</view>
		<view class="btn btn_css" @click="btn">
			提交
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: '',
				isEnroll: '',
				accountList: [{
						value: 0,
						text: "微信"
					},
					{
						value: 1,
						text: "支付宝"
					},
					{
						value: 2,
						text: "银行卡"
					},
				],
				accountValue: '',
				name: '',
				bankList: [{
						id: 0,
						value: 0,
						text: "浦发银行",
						name: "张三",
						number: "123456789110231536"
					},
					{
						id: 1,
						value: 1,
						text: "邮政银行",
						name: "李四",
						number: "123456789110231536"
					}
				],
				bankValue: '',
				bankNumber: '',
				zfb_name: '',
				zfb_Number: '',
			}
		},
		onLoad(e) {
			console.log(1231423, e);
			if (e.type == "1" || e.isEnroll == "0") {
				uni.setNavigationBarTitle({
					title: '绑定支付宝'
				})
			}
			if (e.isEnroll == "1") {
				uni.setNavigationBarTitle({
					title: '修改银行卡'
				})
			}
			if (e.type == "1" || e.isEnroll == "1") {
				uni.setNavigationBarTitle({
					title: '修改支付宝'
				})
			}
			this.type = e.type
		},
		methods: {
			change(e) {
				console.log("e:", e);
			},
			btn() {
				if (this.type == 0) {
					console.log("绑定银行卡");
				} else if (this.type == 1) {
					console.log("绑定支付宝");
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		height: 100%;

		.body {
			.payouts_body {
				.uni-input {
					border: 1px solid #e5e5e5;
					padding: 10rpx;
					border-radius: 15px;
					font-size: 13px;
					background-color: #f4f6fa;
				}
			}

		}

		.btn_css {
			margin-top: 50px;
		}
	}
</style>